/* ===== 根变量定义 ===== */
:root {
  --side-bar-bg-color: #1E293B;
  --body-background-color: #1F1F1F; 
  --control-text-color: #e4e4e4;
  --active-file-bg-color: #9ba2a3;
  --active-file-border-color: #6B6B6B;
  --active-file-text-color: #e7e7e7;
  --table-even-row-color: #f7ffe5;
  --table-head-bg-color: #F8F9FA;
  --code-block-bg-color: #b90000; 
  --default-mono-font: 'JetBrains Mono', 'Menlo';
  --default-regular-font: 'GitLab Sans', -apple-system;
  --text-color: #cacaca;
}

/* ===== 字体定义 ===== */
@font-face {
  font-family: 'JetBrains Mono';
  font-display: optional;
  font-style: normal;
  src: url(./jclee95/JetBrainsMono.woff2) format("woff2")
}

@font-face {
  font-family: 'JetBrains Mono';
  font-display: optional;
  font-weight: bold;
  src: url(./jclee95/JetBrainsMono-Bold.woff2) format("woff2")
}

@font-face {
  font-family: 'JetBrains Mono';
  font-display: optional;
  font-weight: normal;
  font-style: italic;
  src: url(./jclee95/JetBrainsMono-Italic.woff2) format("woff2")
}

@font-face {
  font-family: 'JetBrains Mono';
  font-display: optional;
  font-weight: bold;
  font-style: italic;
  src: url(./jclee95/JetBrainsMono-BoldItalic.woff2) format("woff2")
}

@font-face {
  font-family: 'SourceCodePro';
  font-weight: normal;
  font-style: normal;
  src: local(SourceCodePro), url('./jclee95/SourceCodePro-Regular.ttf');
}

@font-face {
  font-family: 'NotoSansSC';
  font-weight: normal;
  font-style: normal;
  src: url('./jclee95/NotoSansSC-Regular.otf');
}

@font-face {
  font-family: 'NotoSansSC';
  font-weight: bold;
  font-style: normal;
  src: url('./jclee95/NotoSansSC-Bold.otf');
}

/* ===== 基本布局与排版 ===== */
html {
  font-size: 16px;
}

body {
  font-family: 'JetBrains Mono', 'Helvetica', 'SourceCodePro', 'NotoSansSC';
  font-weight: normal;
  line-height: 1.5rem;
  letter-spacing: 0;
  margin: 0;
  background-color: var(--body-background-color);
}

#write {
  max-width: 1200px;
  padding: 30px 50px 20px;
}

#write p {
  text-align: left;
}

#write pre.md-meta-block {
  padding: 1rem;
  font-size: 85%;
  line-height: 1.45;
  background-color: #f7f7f7;
  border: 0;
  border-radius: 3px;
  color: #eeeeee;
  margin-top: 0 !important;
}

.md-image>.md-meta {
  color: #c0c0c0;
  font-size: 0.9rem;
  font-family: 'JetBrains Mono';
  padding: 4px 0;
}

@media print {
  html, body {
    font-size: 14px;
  }

  .md-fences {
    line-height: 1.2rem;
  }

  table, pre {
    page-break-inside: avoid;
  }

  pre {
    word-wrap: break-word;
  }
}

@page {
  size: A4;
  margin: 8mm 0mm;
}

/* ===== 目录样式 ===== */
.md-toc {
  margin-top: 20px;
  padding-bottom: 20px;
  color: var(--deep-theme-color);
}

/* ===== 链接样式 ===== */
a {
  color: var(--deep-theme-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== 标题样式 ===== */
h1, h2, h3, h4, h5, h6 {
  display: block;
  font-weight: bold;
}

h1 {
  font-size: 1.8em;
  line-height: 110%;
  margin-top: 0.67em;
  margin-bottom: 0.67em;
  color: #ffffff;
}

h2 {
  font-size: 1.5em;
  margin-top: 0.83em;
  margin-bottom: 0.83em;
  color: #0bce8d;
}

h3 {
  font-size: 1.17em;
  margin-top: 1em;
  margin-bottom: 1em;
  color: #9a63ff;
}

h4 {
  font-size: 1em;
  margin-top: 1.33em;
  margin-bottom: 1.33em;
  color: #009297;
}

h5 {
  font-size: 1em;
  margin-top: 1.33em;
  margin-bottom: 1.33em;
  color: #a3b859;
}

h6 {
  font-size: 1em;
  margin-top: 1.33em;
  margin-bottom: 1.33em;
  color: #a3a3a3;
}

/* ===== 表格样式 ===== */
table {
  border-collapse: collapse;
  padding: 0;
  word-break: initial;
  width: 100%;
}

table:not(.md-grid-board) {
  border: 1px solid #e1e3e1;
  margin: 20px 0;
  border-collapse: separate;
  border-radius: 19px;
}

table:not(.md-grid-board) td {
  padding: 12px 24px;
  border-left: 1px dashed #e1e3e1;
  border-bottom: 1px dashed #e1e3e1;
  transition: background-color 0.3s ease-out;
}

table:not(.md-grid-board) th {
  padding: 12px 24px;
  border-left: 1px solid #e1e3e1;
  border-bottom: 1px solid #e1e3e1;
  transition: background-color 0.3s ease-out;
}

table thead tr {
  background-color: var(#f8f9fa);
}

table tr:nth-child(odd) {
  background-color: var(#ffffff);
}

table tr:nth-child(even) {
  background-color: var(--table-even-row-color);
}

table:not(.md-grid-board) td:hover,
table:not(.md-grid-board) th:hover {
  background-color: rgba(0, 0, 0, .1);
  text-shadow: 2px 2px 4px rgb(0 0 0 / 20%);
}

/* ===== 引用块样式 ===== */
blockquote {
  border-left: 0.4rem solid #007fc4;
  color: #313131;
  background-color: #F3F0FF;
  font-family: 'JetBrains Mono', 'NotoSansSC';
  font-size: 0.9rem;
  padding: 10px;
}

/* ===== 列表样式 ===== */
ul, ol {
  padding-left: 30px;
}

ul:first-child, ol:first-child {
  margin-top: 0;
}

ul:last-child, ol:last-child {
  margin-bottom: 0;
}

li p.first {
  display: inline-block;
}

.md-task-list-item:hover > input:before, input[type='checkbox']:hover:before {
  opacity: 1;
  transition: 0.5s;
  background-color: #828aac;
}

.task-list-item input::before {
  content: "";
  display: inline-block;
  border-radius: 1.1rem;
  vertical-align: middle;
  border: 1.2px solid var(--deep-theme-color);
  background-color: #ffffff;
  width: 1.1rem;
  height: 1.1rem;
  margin-left: -0.13rem;
  margin-right: 0.1rem;
  margin-top: -0.67rem;
}

.task-list-item input:checked::before {
  padding-left: 0.125em;
  content: '✔';
  color: white;
  background-color: var(--deep-theme-color);
  font-size: 0.8rem;
  line-height: 0.95rem;
  margin-left: -0.13rem;
  margin-right: 0.1rem;
  margin-top: -0.67rem;
  transition: background-color 200ms ease-in-out;
}

.task-list-done {
  text-decoration: line-through;
  color: #adadad;
}

/* ===== 水平分割线样式 ===== */
hr {
  border-style: none;
  border-top-style: solid;
  border-color: #e7e7e7;
  border-width: 1px;
  margin: 2rem 0;
}

/* ===== 高亮样式 ===== */
#write mark {
  background-color: #fff348;
  border-radius: 2px;
  color: black;
  padding: 0 4px;
  margin: 0 2px;
}

/* ===== 行内代码样式 ===== */
#write code, tt {
  padding: 0.6px 4px;
  border-radius: 2px;
  background-color: #000000;
  /* font-family: 'SourceCodePro', Consolas, Courier, 'NotoSansSC';
   */
   font-family: var(--default-mono-font, "Menlo"),"DejaVu Sans Mono","Liberation Mono","Consolas","Ubuntu Mono","Courier New","andale mono","lucida console",monospace;
  font-size: 0.9rem;
  color: var(--code-block-bg-color);
  margin: 0 2px;
}

/* ===== 脚注样式 ===== */
#write .md-footnote {
  color: #777777;
  background-color: #f7f7f7;
}

/* ===== 代码模式样式 ===== */
.cm-s-typora-default .cm-header {
  color: var(--code-block-bg-color);
}
.cm-s-typora-default .cm-link {
  color: var(--deep-theme-color);
}

/* ===== 代码块样式 ===== */
.md-fences {
  border: 1px solid #4B5263; /* 浅灰色边框 */
  border-radius: 5px;
  padding: 5px;
  background: #1E1E1E; /* 深色背景 */
}

.cm-s-inner.CodeMirror {
  color: #D4D4D4; /* 浅灰色文本 */
}

/* ===== 代码块语法高亮样式 ===== */
.cm-s-inner span.cm-comment {
  color: #6A9955; /* 绿色注释 */
}

.cm-s-inner span.cm-atom {
  color: #569CD6; /* 蓝色原子 */
}

.cm-s-inner span.cm-number {
  color: #B5CEA8; /* 浅绿色数字 */
}

.cm-s-inner span.cm-operator {
  color: #D4D4D4; /* 浅灰色运算符 */
}

.cm-s-inner span.cm-comment.cm-attribute {
  color: #9CDCFE; /* 浅蓝色属性 */
}

.cm-s-inner span.cm-comment.cm-def {
  color: #4EC9B0; /* 青色定义 */
}

.cm-s-inner span.cm-comment.cm-tag {
  color: #CE9178; /* 橙色标签 */
}

.cm-s-inner span.cm-comment.cm-type {
  color: #4EC9B0; /* 青色类型 */
}

.cm-s-inner span.cm-property,
.cm-s-inner span.cm-attribute {
  color: #9CDCFE; /* 浅蓝色属性 */
}

.cm-s-inner span.cm-keyword {
  color: #C586C0; /* 紫色关键词 */
}

.cm-s-inner span.cm-builtin {
  color: #DCDCAA; /* 浅黄色内建函数 */
}

.cm-s-inner span.cm-string {
  color: #CE9178; /* 橙色字符串 */
}

.cm-s-inner span.cm-variable {
  color: #9CDCFE; /* 浅蓝色变量 */
}

.cm-s-inner span.cm-variable-2 {
  color: #9CDCFE; /* 浅蓝色变量 */
}

.cm-s-inner span.cm-variable-3,
.cm-s-inner span.cm-type {
  color: #4EC9B0; /* 青色类型/变量 */
}

.cm-s-inner span.cm-def {
  color: #D4D4D4; /* 浅灰色定义 */
}

.cm-s-inner span.cm-bracket {
  color: #D4D4D4; /* 浅灰色括号 */
}

.cm-s-inner span.cm-tag {
  color: #569CD6; /* 蓝色标签 */
}

.cm-s-inner span.cm-header {
  color: #569CD6; /* 蓝色头部 */
}

.cm-s-inner span.cm-link {
  color: #569CD6; /* 蓝色链接 */
}

.cm-s-inner span.cm-error {
  background: #F44747; /* 红色背景错误 */
  color: #1E1E1E; /* 深色文本 */
}

.cm-s-inner .CodeMirror-matchingbracket {
  text-decoration: underline;
  color: white !important; /* 浅灰色匹配括号 */
}

.CodeMirror div.CodeMirror-cursor {
  border-left: 1px solid #D4D4D4; /* 浅灰色光标 */
}

/* ===== 文件节点与信息面板样式 ===== */
.info-panel-tab-title {
  color: wheat;
}

.file-node-content:hover {
  color: #4EC9B0;
  background-color: #2A2D2E;
}

.file-node-title {
  color: white;
}

.file-node-icon {
  color: rgb(218, 218, 218);
}

.fa-folder {
  color: #FFF90B;
}

.fa-file-text-o {
  color: rgb(14, 207, 255);
}

.outline-item-wrapper {
  color: grey;
}

.outline-h1 {
  color: rgb(255, 255, 255);
  font-weight: bold;
}

.outline-h2 {
  color: #d8ffab;
  font-weight: normal !important;
}

.outline-h3 {
  color: #a97aff;
  font-weight: normal !important;
}

.outline-h4 {
  color: #c0c0c0;
  font-weight: normal !important;
}

.outline-h5 {
  color: #777777;
  font-weight: normal !important;
}

